package com.yuanqi.service;

import com.yuanqi.entity.Inventory;
import com.baomidou.mybatisplus.extension.service.IService;
import java.math.BigDecimal;
import java.util.Date;

/**
* @author HP
* @description 针对表【inventory(库存余额)】的数据库操作Service
* @createDate 2025-08-27 11:07:31
*/
public interface InventoryService extends IService<Inventory> {

    /**
     * 减少库存
     * @param warehouseId 仓库ID
     * @param skuId SKU ID
     * @param qty 数量
     * @param batchNo 批次号
     * @return 是否成功
     */
    boolean decreaseInventory(Long warehouseId, Long skuId, BigDecimal qty, String batchNo);

    /**
     * 增加库存
     * @param warehouseId 仓库ID
     * @param skuId SKU ID
     * @param qty 数量
     * @param batchNo 批次号
     * @param expiryDate 有效期
     * @return 是否成功
     */
    boolean increaseInventory(Long warehouseId, Long skuId, BigDecimal qty, String batchNo, Date expiryDate);
}
